home *** CD-ROM | disk | FTP | other *** search
- /* scn1.c - initialize for screen I/O */
-
- #include "stdio.h"
- #include "video.h"
- #include "scn.h"
-
- int scn_init(pscn)
- SCN_DATA *pscn ; /* points to screen data area to init */
- {
- int cols ;
- /* check video mode and reset */
- /* if not 80 col text */
- switch( vid_state(&cols) & 0x07 )
- {
- case BW80_MODE :
- case CO80_MODE :
- case MONO_MODE :
- break ;
- default :
- vid_init(BW80_MODE) ;
- break ;
- }
-
- scn_addr(pscn) ; /* set up screen address */
- vid_page(0) ; /* force page zero */
-
- pscn->cpos = 0 ; /* current position on screen */
- pscn->cattrib = NORMAL_DISPLAY ; /* use normal vedeo attr. */
- vid_state(& (pscn->ncols) ) ; /* get no. columns per line */
- }
-
-
-
- int scn_attrib(pscn,a) /* set screen attribute */
- SCN_DATA *pscn ;
- int a ;
- {
- pscn->cattrib = a ;
- }
-
-
- int scn_pos(pscn,row,col) /* set current position on screen */
- SCN_DATA *pscn ;
- int row ;
- int col ;
- {
- pscn->cpos = (row*(pscn->ncols) + col ) << 1 ;
- }
-
-
-
-